package com.engine4cloud.tdf.supervision.feign;

import com.engine4cloud.tdf.common.core.constant.SecurityConstants;
import com.engine4cloud.tdf.common.core.constant.ServiceNameConstants;
import com.engine4cloud.tdf.common.core.util.R;
import com.engine4cloud.tdf.common.data.web.response.PageInfo;
import com.engine4cloud.tdf.common.data.web.response.Params;
import com.engine4cloud.tdf.supervision.dto.create.RcglInvestigateCreateDTO;
import com.engine4cloud.tdf.supervision.dto.query.RcglInvestigateQueryDTO;
import com.engine4cloud.tdf.supervision.dto.result.RcglInvestigateResultDTO;
import com.engine4cloud.tdf.supervision.dto.update.RcglInvestigateUpdateDTO;
import jakarta.validation.Valid;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;


/**
 * 日常管理-实地查访
 *
 * @author sh
 * @date 2024-08-02 15:07:07
 */
@FeignClient(contextId = "RemoteRcglInvestigateService", value = ServiceNameConstants.SUPERVISION_SERVER)
public interface RemoteRcglInvestigateService {

    /**
     * 分页查询
     *
     * @param page 分页对象
     * @param dto  实地查访
     * @return R<PageInfo < RcglInvestigateResultDTO>>
     */
    @GetMapping("/inner/investigate/page")
    R<PageInfo<RcglInvestigateResultDTO>> getPageList(@RequestParam("page") Params page, @Valid @RequestParam("dto") RcglInvestigateQueryDTO dto,
                                                      @RequestHeader(SecurityConstants.FROM) String from);


    /**
     * 通过id查询实地查访
     *
     * @param id id
     * @return R
     */
    @GetMapping("/inner/investigate/{id}")
    R<RcglInvestigateResultDTO> getById(@PathVariable("id") Long id, @RequestHeader(SecurityConstants.FROM) String from);

    /**
     * 新增实地查访
     *
     * @param dto 实地查访
     * @return R
     */
    @PostMapping("/inner/investigate")
    R<Boolean> create(@Valid @RequestBody RcglInvestigateCreateDTO dto, @RequestHeader(SecurityConstants.FROM) String from);

    /**
     * 修改实地查访
     *
     * @param dto 实地查访
     * @return R
     */
    @PutMapping("/inner/investigate")
    R<Boolean> update(@Valid @RequestBody RcglInvestigateUpdateDTO dto, @RequestHeader(SecurityConstants.FROM) String from);

    /**
     * 通过id删除实地查访
     *
     * @param ids id列表
     * @return R
     */
    @DeleteMapping("/inner/investigate")
    R<Boolean> removeById(@RequestBody Long[] ids, @RequestHeader(SecurityConstants.FROM) String from);
}
